Method and system for addressing registers in a data processing unit in an indirect addressing mode

ABSTRACT

In a data processing unit, an instruction is loaded. Such an instruction includes an operation code field for storing an operation code and at least one operand field, where the operand field includes an indirect addressing mode indicator for indicating enablement of an indirect addressing mode. If an indirect addressing mode is enabled, a general purpose register address is selected from an address field in an indirect register. Finally, the data processing unit addresses a selected one of the plurality of general purpose registers utilizing the general purpose register address during the execution of the operation code by the data processing unit.

CROSS-REFERENCE TO RELATED APPLICATIONS

The present application is related to the following copending applications:

Application Ser. No. 08/313,970, entitled "Method and System For Performing SIMD-Parallel Operations In A Superscalar Data Processing System," Attorney Docket No. AT9-94-045, filed Sep. 28, 1994;

Application Ser. No. 08/313,971, entitled "Method and System For Dynamically Reconfiguring A Register File In A Vector Processor," Attorney Docket No. AT9-94-046, filed Sep. 28, 1994;

Application Ser. No. 08/368,171, entitled "Method and System For Addressing Registers In a Data Processing Unit in an Indexed Addressing Mode," Attorney Docket No. AT9-94-094, filed of even date herewith;

Application Ser. No. 08/368,172, entitled "Method and System for Vector Processing Utilizing Selected Vector Elements," Attorney Docket No. AT9-94-095, filed of even date herewith; and

Application Ser. No. 08/368,173, entitled "Method And System In A Data Processing System For Loading And Storing Vectors In A Plurality Of Modes," Attorney Docket No. AT9-94-073, filed of even date herewith; all of which are assigned to the assignee herein, and incorporated herein by reference thereto.

BACKGROUND OF THE INVENTION

1. Technical Field

The present invention relates in general to an improved data processing system and in particular to an improved method and system for addressing register files in a data processing unit. Still more particularly, the present invention relates to an improved method and system for addressing register files in an indirect addressing mode.

2. Description of the Related Art

Classic approaches to solving numeric problems frequently involve the use of indirect addressing to address a matrix or vector array. Such indirect addressing employs a pointer array containing pointers which are used to point to an element in the vector array currently being processed. This pointing or mapping elements from one array to another may be implemented in software by the following FORTRAN DO-loop:

    DO 100 I=1 to N

    100X (I)=Y(K(I))

Where K is a table of pointers used to access the array Y. In the example above, a copy of the element in Y addressed by the ith element of K is placed into the ith element of array X.

Traditionally, this construct is implemented with all subject arrays located in main memory, which means that two memory accesses are necessary to indirectly access an element, while only a single memory access is necessary to directly access an element. In less expensive data processing system designs that support only a single access port to memory, system performance is compromised during an indirect memory access. To provide multiple, independent memory access ports to these less expensive data processing designs is very expensive. However, with multiple, independent memory access ports, the processor may initiate multiple, concurrent memory access requests, thus reducing the overall time required to execute the indirect memory access function. By incorporating multiple, independent memory access ports, maximum performance may be gained at extreme product costs. Without multiple, independent memory access ports, cost is reduced at the expense of performance.

The benefits of indirect addressing may be exploited in a number of application areas, such as sparse-matrix calculations, and dense vector multiplication. Other functions exploited by indirect addressing include population count (i.e., counting the number of one's in a word) and various character-based translations, such as translating ASCII to EBCDIC.

Thus the problem remaining in the prior art is to provide a method and system for indirectly addressing registers that avoids the performance degradation due to the need for two memory accesses, and avoids the expense of multiple, independent memory access ports.

SUMMARY OF THE INVENTION

It is therefore one object of the present invention to provide an improved data processing system.

It is another object of the present invention to provide an improved method and system for addressing register files in a data processing unit.

It is yet another object of the present invention to provide an improved method and system for addressing register files in an indirect addressing mode.

The foregoing objects are achieved as is now described. In a data processing unit, an instruction is loaded. Such an instruction includes an operation code field for storing an operation code and at least one operand field, where the operand field includes an indirect addressing mode indicator for indicating enablement of an indirect addressing mode. If an indirect addressing mode is enabled, a general purpose register address is selected from an address field in an indirect register. Finally, the data processing unit addresses a selected one of the plurality of general purpose registers utilizing the general purpose register address during the execution of the operation code by the data processing unit.

The above as well as additional objects, features, and advantages of the present invention will become apparent in the following detailed written description.

BRIEF DESCRIPTION OF THE DRAWINGS

The novel features believed characteristic of the invention are set forth in the appended claims. The invention itself however, as well as a preferred mode of use, further objects and advantages thereof, will best be understood by reference to the following detailed description of an illustrative embodiment when read in conjunction with the accompanying drawings, wherein:

FIG. 1 depicts a high-level block diagram of a superscalar data processing system having an SIMD execution unit in accordance with a preferred embodiment of the present invention;

FIG. 2 is a high-level block diagram which further illustrates the components within the SIMD execution unit in accordance with the method and system of the present invention;

FIG. 3 depicts a more detailed block diagram of a processing element in accordance with the method and system of the present invention;

FIG. 4 illustrates fields of an instruction word in accordance with the method and system of the present invention;

FIG. 5 is a high-level block diagram which illustrates the major components and data flow utilized to implement indirect addressing in accordance with the method and system of the present invention;

FIG. 6 depicts a high-level block diagram which illustrates the major components and data flow utilized to implement a second embodiment of indirect register addressing in accordance with the method and system of the present invention; and

FIG. 7 is a high-level flowchart illustrating the process of selecting a general purpose register address in accordance with the method and system of the present invention.

DETAILED DESCRIPTION OF PREFERRED EMBODIMENT

With reference now to the figures and in particular with reference to FIG. 1, there is depicted a high-level block diagram of a superscalar data processing system having an SIMD execution unit in accordance with a preferred embodiment of the method and system of the present invention. As illustrated, superscalar data processing system 100 includes branch execution unit 102, which is coupled to memory 104 via instruction bus 106 and address bus 108. Branch execution unit 102 fetches instructions from memory 104 and dispatches such instructions to execution units 110-116 via instruction dispatch buses 118. Instruction dispatch buses may be implemented with a few buses shared by all execution units in superscalar data processing system 100, or multiple, dedicated buses for each execution unit.

Memory 104 may be implemented in different hierarchical levels of memory having different speeds and capacities. Such levels of memory may be structured such that from the viewpoint of any particular level in the hierarchy, the next lowest level is considered to be a cache. A cache memory is an auxiliary memory that provides a buffering capability by which a relatively slow and large main memory can interface to an execution unit such as branch execution unit 102 (or to a next higher level of memory) at the cycle time of such an execution unit.

In the example illustrated in FIG. 1, execution unit 116 is an SIMD execution unit, or a "vector processor" execution unit. Thus, within superscalar data processing system 100, branch execution unit 102 interfaces with SIMD execution unit 116 as another "execution class" among the variety of classes of execution units present in superscalar data processing system 100.

Other execution units within superscalar data processing system 100 may include: load/store execution unit 110, floating-point execution unit 112, and fixed-point execution unit 114. Load/store execution unit 110, which is coupled to memory 104 via bus 120, may be utilized to calculate addresses and provide such addresses to memory 104 during the execution of instructions that require memory access. Load/store execution unit 110 may be utilized to provide an address to memory 104 during the execution of instructions in other execution units.

Floating-point execution unit 112, which is coupled to memory 104 via bus 122, may be utilized to perform floating-point arithmetic operations. Fixed-point execution unit 114 is coupled to memory 104 via bus 124. SIMD execution unit 116 is coupled to memory 104 via bus 126, which is discussed in greater detail below.

With reference now to FIG. 2, there is depicted a high-level block diagram which generally illustrates the components within superscalar data processing system 100 (see FIG. 1), and more specifically illustrates components within SIMD execution unit 116 and the interface between SIMD execution unit 116 and other components in superscalar data processing system 100 in accordance with the method and system of the present invention. As illustrated, superscalar data processing system 100 includes branch execution unit 102, floating-point execution unit 112, fixed-point execution unit 114, and SIMD execution unit 116. In this example, fixed-point execution unit 114 performs the role of load/store execution unit 110, which is illustrated in FIG. 1.

Branch execution unit 102 provides address signals to memory 104 via address bus 108, and receives instructions from memory 104 via instruction bus 106. Such received instructions are then dispatched to selected execution units including floating-point execution unit 112, fixed-point execution unit 114, and SIMD execution unit 116, via instruction buses 118. Branch execution unit 102 dispatches instructions to an execution unit that is designated to perform the type of operation represented by the dispatched instruction. For example, an instruction representing a floating-point arithmetic operation is dispatched by branch execution unit 102 to floating-point execution unit 112.

Floating-point execution unit 112 may include a plurality of arithmetic logic units (ALUs) coupled to a group of "floating-point registers"(FPRs). Floating-point execution unit 112 is coupled to memory 104 via data bus 122. Similarly, fixed-point execution unit 114 may include a plurality of arithmetic logic units coupled to a group of "general purpose registers"(GPRs), and may be coupled to memory 104 via address bus 120 and data bus 124. Fixed-point execution unit 114 may calculate and provide addresses for all data memory accesses, thereby performing the role of load/store execution unit 110, which is illustrated in FIG. 1.

In the embodiment illustrated, SIMD execution unit 116 includes control unit 130, vector register interface unit 216, and a plurality of processing elements 132. Control unit 130 provides controls for processing elements 132 by dispatching processing element commands to selected processing elements 132 via command bus 134. Control unit 130 also provides control signals via bus 138 to vector register interface unit 216, where such control signals control the transfer of data between memory 104 and selected processing elements 132. Memory 104 is coupled to vector register interface unit 216 via data bus 126. Vector register interface unit 216 is also coupled to every processing element 132 with plurality of separate data buses 136.

In a preferred embodiment, control unit 130 includes three main functional units: (1) an instruction assembly unit, (2) an instruction expansion unit, and (3) a command dispatch unit. The instruction assembly subunit within control unit 130 provides the instruction and control interface with other execution units within superscalar data processing system 100 by receiving, buffering, and pipelining vector instructions dispatched from branch execution unit 102. Control unit 130 also receives and buffers storage access control information from fixed-point execution unit 114 transmitted on interface bus 195. Such storage access control information may include addresses calculated by fixed-point execution unit 114 and vector length information which may be used by fixed-point execution unit 114 to determine the size of a memory access.

Control unit 130 holds dispatched instructions and associated control information until branch execution unit 102 commits the instruction to complete execution. After branch execution unit 102 commits an SIMD execution unit to complete, no previously dispatched instruction can cause the SIMD execution unit instruction to abort.

An instruction queue within control unit 130 stores dispatched instructions awaiting execution. If the instruction queue is nearly full, control unit 130 notifies branch execution unit 102 that the SIMD execution unit 116 is unable to accept additional instructions. Instructions are released from the instruction queue for execution after receiving a completion signal from branch execution unit 102. Such a completion signal commits the instruction to complete. Branch execution unit 102 commits an instruction to complete after evaluating data, address, and control flow hazards that may occur because of out-of-order execution of instructions in other execution units.

The instruction expansion unit within the instruction control unit translates SIMD execution unit instructions into commands which may be dispatched to selected processing elements 132 and executed simultaneously within such selected processing elements 132 to carry out the SIMD execution unit instruction. When the instruction expansion subunit dispatches commands to several selected processing elements 132, such selected processing elements may be coordinated to provide portions of a vector which is the result of a vector calculation. For example, if a vector contains sixteen elements, eight processing elements 132 may each be utilized to execute two commands utilizing two elements as operands to produce a full sixteen-element vector result. Thus, two sets of commands are dispatched from the instruction expansion subunit to coordinate eight processing elements in operating on two elements each to produce the full sixteen-element vector result.

The command dispatch unit within the instruction control unit dispatches subsection commands (which includes processing element commands) as dispatch conditions are met. Such dispatched conditions include the detection that no register dependency collisions have occurred and the condition that all processing elements are ready to receive commands (i.e., input queues are not full). The command dispatch logic enables out-of-order execution of processing element commands generated by the instruction expansion unit. Such out-of-order execution allows parallel execution of loads or stores with execution of arithmetic operations.

In a vector load operation, when fixed-point execution unit 114 sends a sequence of requests for data to memory 104 on behalf of SIMD execution unit 116, the data requested may not be returned to SIMD execution unit 116 in the order in which the data was requested. For example, if requested data resides in cache memory (part of the hierarchical structure of memory 104), memory 104 may respond within a short period of time by sending the requested data to SIMD execution unit 116. However, if requested data is not located in the relatively fast cache memory, such requested data may be retrieved from a memory location having a relatively high latency compared with the latency of cache. This means that memory 104 sends some requested data to SIMD execution unit 116 sooner than other data.

While SIMD execution unit 116 is waiting for data from a slower memory location, other subsequently requested data may be sent to SIMD execution unit 116 before earlier requested data. To keep track of what data is received by SIMD execution unit 116 as a result of a particular memory request, memory requests are assigned an identifier, which is then later associated with the requested data recalled from memory 104. Such an identifier is then transferred with the requested data to SIMD execution unit 116. Control unit 130 tracks outstanding memory accesses utilizing these assigned identifiers. When all outstanding memory requests have been honored (i.e., data has been received for each outstanding identifier), control unit 130 initiates the transfer of the received data to the processing elements depending on the type of load instruction that was utilized to request the data.

With reference now to FIG. 3, there is depicted a more detailed representation of processing elements 132 (see FIG. 2) in accordance with the method and system of the present invention. As illustrated, a plurality of processing elements 230-234 (same as processing elements 132 in FIG. 2) are coupled to control unit 130 via common command bus 134 and individual data buses 136 coupled to each processing element 230-234.

In one embodiment of the present invention, processing elements 230-234 each include a register file 236, which may include 512 64-bit registers. Each register may be utilized to store an element in a vector and be used by an arithmetic logic unit (discussed below) to perform various operations. Together, register files 236 associated with each processing element 230-234 form a register array 238 having n sequentially numbered rows of registers and m sequentially numbered columns of registers. Thus, if register files 236 each include 512 registers, and SIMD execution unit 116 contains eight processing elements 230-234, register array 238 includes eight rows of registers and 512 columns of registers.

Vector registers, comprising a plurality of elements, are formed in the columns of register array 238. Additionally, a single vector register may be comprised of registers in more than one column, thereby permitting vector registers having a number of elements larger than n elements.

Each processing element 230-234 may also include an arithmetic logic unit 240. Such an arithmetic logic unit 240 may include both a fixed-point execution unit 242 and a floating-point execution unit 244. Preferably, both fixed- and floating-point execution units have a design similar to fixed-point execution unit 114 and floating-point execution unit 112 in superscalar processor 100 of FIG. 1. By using similar designs, the expense of designing and testing new fixed- and floating-point execution units may be saved. Arithmetic logic unit 240 utilizes operands stored in register file 236 and stores results of operations back into register file 236. Thus, an instruction word intended for execution by arithmetic logic unit 240 may include fields containing data that specifies registers to be utilized for source operands and a register for storing the result of such instruction execution.

Also included within processing elements 230-234 are control registers 246. Some control registers 246 may contain status information reflecting the condition of similar registers in control unit 130. Other control registers 246 may be used during operations that require indexed or indirect addressing of registers in register file 236. An example of control registers 246 includes indirect registers, which are discussed below with reference to FIG. 5.

With reference now to FIG. 4, there is depicted various fields of an instruction word in accordance with the method and system of the present invention. As illustrated, instruction word 300 includes operation code (OP code) field 302, operand field 304, operand field 306, and operand field 308. In a preferred embodiment, instruction word 300 includes 64 bits operation code field 302 includes 31 bits, and each operand field 304-308 includes 11 bits. The contents of OP code field 302 may specify an operation to be performed by a data processing unit, such as ALU 240 of processing element 230 in FIG. 3. Such operations typically require use of registers, such as those contained in register file 236 of FIG. 3.

Operations specified by OP code 302 may utilize three operands: a target operand, which may be stored in operand field 304; an A operand, which may be stored in operand field 306; and a B operand, which may be stored in operand field 308. An example of an instruction that may be specified by OP code 302 is an instruction which adds a value contained in a register specified by operand A in operand field 306 to a value contained in a second register specified by operand B in operand field 308, and then stores the result of such an add operation in a target register specified by target operand in operand field 304. Those persons skilled in the art should recognize that not all instructions specified by OP code 302 will require operands which may be stored in operand fields 304-308--other instructions may use from zero to three operands. Some architectures support a fourth operand for instructions such as multiply-add (T=A×B+C). When a fourth operand is supported, those architectures define a fourth operand field in the instruction format at the expense of opcode bits or size of the other three operand fields.

When an indirect addressing mode has been enabled, the operand field utilized in such an indirect mode may contain information having a format illustrated at operand 310. As illustrated, operand 310 includes indirect addressing bit 312, and may include optional bits 314, which may be utilized to select an address field from an indirect register. Such a selection utilizing bits 314 is discussed below in greater detail with reference to FIG. 6. In this example, indirect addressing has been enabled when indirect addressing bit 312 equals one.

If indirect addressing bit 312 is set such that indirect addressing mode is disabled, the operand field may contain data in a format depicted at operand field 320. In this example, indirect addressing mode is disabled when indirect addressing bit 312 is set to zero. When the indirect addressing mode is disabled, every bit in the operand field except the indirect addressing bit 312 may be utilized to specify a direct general purpose register address, as illustrated by direct address field 322. Operand fields 304-308 of instruction word 300 may each independently utilize the indirect addressing mode or the direct addressing mode, as selected by the value stored in indirect addressing bit 312.

With reference now to FIG. 5, there is depicted a high-level block diagram which illustrates the major components and data flow utilized to implement indirect addressing in accordance with the method and system of the present invention. As illustrated, operand field 304 includes indirect addressing bit 312, whether or not indirect addressing mode is enabled. If indirect addressing mode is enabled in the embodiment depicted in FIG. 5, the remainder of operand field 304 may be ignored. If indirect addressing mode is not enabled, the remainder of operand field 304 may include a direct address field, which is illustrated at reference numeral 322. Such a direct address field may be utilized to store a general purpose register address. Other components utilized in implementing indirect mode addressing include indirect register 330 and multiplexor 334.

When indirect addressing mode is enabled by setting indirect addressing bit 312, multiplexor 334 selects data 336 from indirect register 330 to be utilized as general purpose register address 342.

When indirect addressing mode is not selected, the value of indirect addressing bit 312 causes multiplexor 334 to select the value contained in direct address field 322, which is then utilized as general purpose register address 342. Thus, in such a direct addressing mode, general purpose register address 342 is equal to the value stored in direct address field 322, as indicated by data flow 338.

With reference now to FIG. 6, there is depicted a high-level block diagram which illustrates the major components and data flow utilized to implement a second embodiment of indirect register addressing in accordance with the method and system of the present invention. As illustrated, operand field 304 includes indirect addressing bit 312, whether or not indirect addressing mode is enabled. If indirect addressing mode is enabled, operand files 304 may include selection bits 314, which may be utilized to select data from a plurality of address fields in indirect register 350. In a manner similar to that discussed with reference to FIG. 5, multiplexor 334 selects data from direct address field 322 via data flow 338 or data from indirect register 350 via data flow 336, to produce general purpose register address 342.

When indirect addressing mode is enabled by setting indirect address addressing bit 312, multiplexor 334 selects data on data path 336 to be used as general purpose register address 342. Multiplexor 352 utilizes selection bits 314 to select from a plurality of address fields within indirect register 350. Each address field within register 350 contains a value which may be utilized as a general purpose register address. Thus, data on data path 336 is selected from a plurality of address fields within indirect register 350 by multiplexor 352 in accordance with the condition of selection bits 314.

In the embodiment illustrated in FIG. 6, indirect register 350 may be loaded with four addresses, from which general purpose register address 342 may be selected. Indirect register 350 may be loaded by the execution of a load instruction in superscalar processor 100 (see FIG. 1).

When indirect addressing mode is not selected, the value of indirect addressing bit 312 causes multiplexor 334 to select the value contained in direct address field 322, as illustrated by data flow 338. Thus, in such a direct addressing mode, general purpose register address 342 is equal to the value stored in direct address field 322.

With reference now to FIG. 7, there is depicted a high-level flowchart illustrating the process of selecting a general purpose register address in accordance with the method and system of the present invention. As illustrated, the process--which is conducted independently for each operand field--begins at block 400, and thereafter passes to block 402. Block 402 illustrates the process of determining whether or not the indirect addressing mode has been selected as indicated by the indirect addressing bit. If the indirect addressing mode has not been selected, the process utilizes the remaining contents of the operand field as a direct general purpose register address, as depicted at block 404. Thereafter, the process of selecting a general purpose register address ends, as illustrated at block 406.

Referring again to block 402, if the indirect addressing mode has been selected, an address field is selected from the indirect register as indicated by indirect register field select bits in the operand field, as depicted at block 408. Thereafter, the contents of the selected address field within the indirect register is utilized as the general purpose register address, as illustrated at block 410. The process of selecting a general purpose register address ends, as depicted at block 406.

While indirect addressing of general purpose registers utilizing data stored in an indirect register is described above with reference to a superscalar data processing system having an SIMD processing element, those persons skilled in the art should recognize that scalar processing systems having a much less complex design may also benefit from the method and system disclosed herein. Thus, virtually any central processing unit having a plurality of general purpose registers may utilize the present invention to specify a general purpose register address in the operand field of an instruction word intended for that central processing unit.

While the invention has been particularly shown and described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention. 

What is claimed is:
 1. A data processing unit comprising:an indirect register having a plurality of fields; a plurality of registers; means for loading an instruction into said data processing unit, wherein said instruction includes an operation code field for storing an operation code, an indirect register selection field, and an operand field, wherein said operand field includes an indirect addressing mode indicator for indicating an enablement of an indirect addressing mode; means for selecting one of said plurality of fields within said indirect register according to said indirect register selection field, in response to an indication that said indirect addressing mode is enabled; and means for addressing one of said plurality of registers according to said one selected field during execution within said data processing unit of an operation specified by said operation code.
 2. The data processing unit according to claim 1, wherein said indirect addressing mode indicator for indicating enablement of an indirect addressing mode further includes an indirect addressing bit.
 3. The data processing unit according to claim 1, wherein said data processing unit further includes a means for addressing one of said plurality of registers according to bits from said operand field during execution within said data processing unit of an operation specified by said operation code, in response to an indication that said indirect addressing mode is not enabled. 